package sample.testTickManager
{
	import org.abc.interfaces.ITick;
	import flash.display.Shape;
	import flash.display.Stage;
	import flash.filters.DropShadowFilter;
	import flash.filters.GlowFilter;
	import flash.filters.GradientGlowFilter;
	import flash.geom.Point;

	/**
	 * @describe  	...
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		2011-8-11 13:10
	 */
	public class TickMouseEvent implements ITick
	{
		private var _stage:Stage;
		private var _items:Vector.<Shape>;
		private var _objs:Array;

		private var _isPlay:Boolean;
		private var _startTime:int;
		private var _tickGap:int;
		private var _executeTime:int;

		public function TickMouseEvent(gameStage:Stage):void
		{
			_stage=gameStage;
			_items=new Vector.<Shape>();
			_objs=new Array();
		}

		/* INTERFACE blog.zihua2007.interfaces.ITick */

		public function get isPlay():Boolean
		{
			return _isPlay;
		}

		public function set isPlay(value:Boolean):void
		{
			_isPlay=value;
		}

		public function get startTime():int
		{
			return _startTime;
		}

		public function set startTime(value:int):void
		{
			_startTime=value;
		}

		public function get tickGap():int
		{
			return _tickGap;
		}

		public function set tickGap(value:int):void
		{
			_tickGap=value;
		}

		public function get executeTime():int
		{
			return _executeTime;
		}

		public function set executeTime(value:int):void
		{
			_executeTime=value;
		}

		public function tick():void
		{
			_objs=_stage.getObjectsUnderPoint(new Point(_stage.mouseX, _stage.mouseY));
			for each (var item:Shape in _items)
			{
				item.filters=[];
			}
			for each (var item2:Shape in _objs)
			{
				item2.filters=[new GlowFilter()];
				_items.push(item2);
			}
		}
	}

}
